package com.atguigu.springboot.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: 19shusheng.com
 * @Description:
 * @Date: Created in 22:10 2020/10/20
 * @Modified By:
 */
@Configuration
public class ApplicationContextConfig {

    /**
     *
     * @Description: 将restTemplate注入到spring容器当中
     *  @Bean 相当于applicationContext.xml的<bean id="" class=""/>这种方式
     *
     * @auther: madonghui
     * @date: 22:11 2020/10/20
     * @param: []
     * @return: org.springframework.web.client.RestTemplate
     *    LoadBalanced是ribbon的注解
     */
    @Bean
  //  @LoadBalanced
    public RestTemplate getRestTemplcate(){
        return new RestTemplate();
    }

}
